package com.caigou.mapper.cms;

import com.caigou.bean.cms.entity.SurveyOption;
import com.caigou.bean.cms.param.MoveOptionParam;
import com.caigou.bean.cms.param.QueryFormParam;
import com.caigou.pojo.SurveyFormComponentOption;
import com.caigou.pojo.SurveyFormOptionListData;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.List;

public interface SurveyOptionMapper {
    int deleteByPrimaryKey(@Param("id") Integer id);

    int deleteByQuestionId(@Param("questionId") Integer questionId);

    int insert(SurveyOption record);

    int insertSelective(SurveyOption record);

    SurveyOption selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(SurveyOption record);

    int updateByPrimaryKey(SurveyOption record);

    int updateOptionOrderByPrimaryKey(SurveyOption surveyOption);

    List<SurveyOption> selectByQuestionId(@Param("questionId") Integer questionId);

    int updateOrderForBack(MoveOptionParam param);

    int updateOrderForFront(MoveOptionParam param);

    int batchUpdateOptionOrder(SurveyOption surveyOption);

    Integer getMaxOrderByQuestionId(@Param("questionId")Integer questionId);

    int deleteByFormId(@Param("formId")String formId);

    List<SurveyFormOptionListData> loadSurveyFormOptionListData(@Param("formId") String formId, @Param("questionId") Integer questionId);

    SurveyFormOptionListData loadSurveyFormOptionListDataById(@Param("optionId") Integer optionId);

    int updateOptionSubmitCount(@Param("id") Integer id);

    List<SurveyFormComponentOption> loadSurveyFormComponentOption(Integer questionId);

    List<SurveyOption> loadSurveyOptionByIds(@Param("answer") String answer);

    int updateSurveyFormOptionSubmitCount(@Param("optionId") Integer optionId, @Param("changeCount") Integer changeCount);

    String loadFormIdByOption(@Param("optionId") Integer optionId);

    Integer loadOptionSubmitCount(@Param("optionId") Integer optionId);
}